<html>
<head>
    <title>登录</title>
    <meta name="decorator" content="blank"/>
    <link href="${ctxPath}/css/public.css" type="text/css" rel="stylesheet">
    <link href="${ctxPath}/css/login.css" type="text/css" rel="stylesheet">

</head>
<body>
<div class="container login-container">
    <div class="login-body">
        <div class="login-title">
            <div class="login-title-bg blue-bg"></div>
            <h1 class="main-color">珠海金湾</h1>
        </div>
        <br/>
        <div class="login-title">
            <div class="login-title-bg blue-bg"></div>
            <h1 class="main-color">人才服务管理系统</h1>
        </div>
        <div class="login-main">
            <div class="login-box back-login">
                <h2 class="main-color">人才补贴系统<span style="margin-left: 20px;color: red;">${errorMessage!''}</span></h2>

                <form id="loginForm" class="form-signin" action="${ctxPath}/login.do" method="post">
                    <input type="hidden" name="dateData" value=${dateData!''}>
                    <input type="hidden" name="username" value=${username!''}>
                    <input type="hidden" name="checkData" value=${checkData!''}>
                    <input type="hidden" name="loginType" value=${loginType!''}>
                    <div class="input-div">
                        <span>账号</span>
                        <div>
                            <input type="text" id="username" name="code" value="" />
                        </div>
                    </div>
                    <div class="input-div">
                        <span>密码</span>
                        <div>
                            <input type="password" id="password" name="password" value=""/>
                        </div>
                    </div>
                    <div class="input-div">
                        <span>验证码</span>
                        <div>
                            <input type="text" id="checkCode" name="checkCode" style="width:60%" value=""/>
                            <img id="checkCodeImg" class="checkCodeImg" src="${ctxPath}/captcha" onclick="refreshCode()"/>
                        </div>
                    </div>
                    <div class="login-form-bottom">
                        <span class="loginError"></span>
                        <input class="btn btn-big btn-blue" type="submit" value="登 录"  onclick="return check(this.from)" />
                    </div>
                </form>
            </div>
            <!--<div class="login-box info-login">-->
                <!--<a href="javascript:void(0)" onclick="window.open('${ctxPath}/cms/applyAccount/add.do');"></a>-->
            <!--</div>-->
        </div>
    </div>
    <div class="login-footer">
       2012-2020 <a href="">珠海金湾人才服务管理系统</a>
    </div>
</div>
<script>
    function check(form){
        console.log(document.getElementById("password").value);
        document.getElementById("password").value = window.btoa(document.getElementById("password").value);
        return true;
    }
    function refreshCode() {
        var dom = document.getElementById("checkCodeImg");
        dom.src = "${ctxPath}/captcha";
    }

    //判断当前浏览类型
    var Browser=(function(window){
        var document = window.document,
            navigator = window.navigator,
            agent = navigator.userAgent.toLowerCase(),
            //IE8+支持.返回浏览器渲染当前文档所用的模式
            //IE6,IE7:undefined.IE8:8(兼容模式返回7).IE9:9(兼容模式返回7||8)
            //IE10:10(兼容模式7||8||9)
            //IE 11
            IEMode = document.documentMode,
            //chorme
            chrome = window.chrome || false,
            System = {
                //user-agent
                agent : agent,
                //是否为IE
                isIE : /msie/.test(agent) || /rv:([\d.]+)\) like gecko/.test(agent), //ie 11太特殊了
                //Gecko内核
                isGecko: agent.indexOf("gecko")>0 && agent.indexOf("like gecko")<0,
                //webkit内核
                isWebkit: agent.indexOf("webkit")>0,
                //是否为标准模式
                isStrict: document.compatMode === "CSS1Compat",
                //是否支持subtitle
                supportSubTitle:function(){
                    return "track" in document.createElement("track");
                },
                //是否支持scoped
                supportScope:function(){
                    return "scoped" in document.createElement("style");
                },
                //获取IE的版本号
                ieVersion:function(){
                    try {
                        if(agent.indexOf('11.0') > -1){
                            return 11;
                        }
                        return agent.match(/msie ([\d.]+)/)[1] || 0; //ie 11获取不到版本号
                    } catch(e) {
                        console.log("error");
                        return IEMode;
                    }
                },
                //Opera版本号
                operaVersion:function(){
                    try {
                        if(window.opera) {
                            return agent.match(/opera.([\d.]+)/)[1];
                        } else if(agent.indexOf("opr") > 0) {
                            return agent.match(/opr\/([\d.]+)/)[1];
                        }
                    } catch(e) {
                        console.log("error");
                        return 0;
                    }
                },
                //描述:version过滤.如31.0.252.152 只保留31.0
                versionFilter:function(){
                    if(arguments.length === 1 && typeof arguments[0] === "string") {
                        var version = arguments[0];
                        start = version.indexOf(".");
                        if(start>0){
                            end = version.indexOf(".",start+1);
                            if(end !== -1) {
                                return version.substr(0,end);
                            }
                        }
                        return version;
                    } else if(arguments.length === 1) {
                        return arguments[0];
                    }
                    return 0;
                }
            };

        try {
            //浏览器类型(IE、Opera、Chrome、Safari、Firefox)
            System.type = System.isIE?"IE":
                window.opera || (agent.indexOf("opr") > 0)?"Opera":
                    (agent.indexOf("chrome")>0)?"Chrome":
                        //safari也提供了专门的判定方式
                        window.openDatabase?"Safari":
                            (agent.indexOf("firefox")>0)?"Firefox":
                                'unknow';

            //版本号
            System.version = (System.type === "IE")?System.ieVersion():
                (System.type === "Firefox")?agent.match(/firefox\/([\d.]+)/)[1]:
                    (System.type === "Chrome")?agent.match(/chrome\/([\d.]+)/)[1]:
                        (System.type === "Opera")?System.operaVersion():
                            (System.type === "Safari")?agent.match(/version\/([\d.]+)/)[1]:
                                "0";

            //浏览器外壳
            System.shell=function(){
                //遨游浏览器
                if(agent.indexOf("maxthon") > 0) {
                    System.version = agent.match(/maxthon\/([\d.]+)/)[1] || System.version ;
                    return "傲游浏览器";
                }
                //QQ浏览器
                if(agent.indexOf("qqbrowser") > 0) {
                    System.version = agent.match(/qqbrowser\/([\d.]+)/)[1] || System.version ;
                    return "QQ浏览器";
                }

                //搜狗浏览器
                if( agent.indexOf("se 2.x")>0) {
                    return '搜狗浏览器';
                }

                //Chrome:也可以使用window.chrome && window.chrome.webstore判断
                if(chrome && System.type !== "Opera") {
                    var external = window.external,
                        clientInfo = window.clientInformation,
                        //客户端语言:zh-cn,zh.360下面会返回undefined
                        clientLanguage = clientInfo.languages;

                    //猎豹浏览器:或者agent.indexOf("lbbrowser")>0
                    if( external && 'LiebaoGetVersion' in external) {
                        return '猎豹浏览器';
                    }
                    //百度浏览器
                    if (agent.indexOf("bidubrowser")>0) {
                        System.version = agent.match(/bidubrowser\/([\d.]+)/)[1] ||
                            agent.match(/chrome\/([\d.]+)/)[1];
                        return "百度浏览器";
                    }
                    //360极速浏览器和360安全浏览器
                    if( System.supportSubTitle() && typeof clientLanguage === "undefined") {
                        //object.key()返回一个数组.包含可枚举属性和方法名称
                        var storeKeyLen = Object.keys(chrome.webstore).length,
                            v8Locale = "v8Locale" in window;
                        return storeKeyLen > 1? '360极速浏览器':'360安全浏览器';
                    }
                    return "Chrome";
                }
                return System.type;
            };

            //浏览器名称(如果是壳浏览器,则返回壳名称)
            System.name = System.shell();
            //对版本号进行过滤过处理
            System.version = System.versionFilter(System.version);

        } catch(e) {
            console.log("error");
        }
        return {
            client:System
        };

    })(window);

    window.onload = function(){
        var browserName = Browser.client.name;
        var browserVersion = Browser.client.version;
        if(browserName == 'Chrome'){
            if(browserVersion < 60){
                alert("你的google chrome浏览器版本过低");
            }
        }else if(browserName == 'Firefox'){
            //do nothing
        }
        else{
            alert("google chrome浏览器使用效果最佳,请使用google chrome浏览器");
            window.open("https://pc.qq.com/detail/1/detail_2661.html");
        }
    }

</script>
</body>
</html>